//
//  PKReadingModel.m
//  PianKe
//
//  Created by mingtao on 15/10/9.
//  Copyright (c) 2015年 mingtao. All rights reserved.
//

#import "PKReadingModel.h"
#import "PKReadingCarousel.h"
#import "PKReadingModelList.h"
@implementation PKReadingModel

-(void)setValue:(id)value forKey:(NSString *)key
{
    if ([key isEqualToString:@"list"]) {
        _list = [NSMutableArray arrayWithCapacity:0];
        
        for (NSDictionary *keylist in value) {
            PKReadingModelList *Readinglist=[[PKReadingModelList alloc]init];
            
            [Readinglist setValuesForKeysWithDictionary:keylist];
            
            [self.list addObject:Readinglist];
        }
    }else if ([key isEqualToString:@"carousel"])
    {
        _carousel = [NSMutableArray arrayWithCapacity:0];
        
        for (NSDictionary *keycarousel in value) {
            PKReadingCarousel *readingCarouser=[[PKReadingCarousel alloc]init];
            
            [readingCarouser setValuesForKeysWithDictionary:keycarousel];
            
            [self.carousel addObject:readingCarouser];
        }
    }else
    {
        [super setValue:value forKey:key];
    
    }

}

@end
